Linked Questions

0 votes
0 answers
4k views

I'm a new programmer, sorry If my question is too basic I created a mybutton.ui file in Qt Designer, Then I want to run it through my python app. the mybutton.ui file is next to Qt-Designer-GUI-Code....
Ashkan Bigdeli's user avatar
3 votes
0 answers
3k views

import sys from PyQt5.uic import loadUi from PyQt5 import QtWidgets from PyQt5.QtWidgets import QDialog, QApplication, QWidget from PyQt5.QtGui import QPixmap from PyQt5 import uic class WelcomeScreen(...
pirateSteel's user avatar
0 votes
1 answer
1k views

Suppose I have a collection of functions in a module called my_functions.py. One of these functions must load data from a text file that is stored in the same directory as my_functions.py. For ...
tnknepp's user avatar
  • 6,303
266 votes
7 answers
165k views

How can I read a file that is inside my Python package? A package that I load has a number of templates (text files used as strings) that I want to load from within the program. But how do I specify ...
ronszon's user avatar
  • 3,387
180 votes
16 answers
132k views

We have a system that has some Bash scripts running besides Java code. Since we are trying to test everything that could possibly break, and those Bash scripts may break, we want to test them. The ...
nimcap's user avatar
  • 10.6k
45 votes
5 answers
85k views

I have Directory structure like this projectfolder/fold1/fold2/fold3/script.py now I'm giving script.py a path as commandline argument of a file which is there in fold1/fold_temp/myfile.txt So ...
niyant's user avatar
  • 499
6 votes
2 answers
6k views

Situation: My Python script has a line of code that copies itself to another directory shutil.copyfile(os.path.abspath(__file__), newPath) Problem: The script is then compiled into an EXE and ran. ...
Timothy Wong's user avatar
6 votes
1 answer
21k views

I've successfully built a Docker container and copied my application's files into the container in the Dockerfile. However, I am trying to execute a Python script that references an input file (that ...
LouiseEMastiz's user avatar
4 votes
3 answers
3k views

I'm trying to run code from this repo: https://github.com/tylin/coco-caption, specifically from https://github.com/tylin/coco-caption/blob/master/pycocoevalcap/tokenizer/ptbtokenizer.py, line 51-52: ...
lars's user avatar
  • 2,026
4 votes
4 answers
2k views

So I am writing a code where I need to import a file. Both the python code file and the file I need to import are in the same directory thus I haven't specified the whole path. The code works fine in ...
switchblade's user avatar
1 vote
2 answers
5k views

How do I call the relative path of batch file from python? My python script 'Script.py' is in the directory "d:\2014\python\script.py" from this file i would like to call a batch file "d:\2014\input\...
user3349459's user avatar
6 votes
1 answer
2k views

The Goal: Access / Write to the same temp files when using a common utility function called from various python modules. Background: I am using the python Unittest module to run sets of custom tests ...
Adam Lewis's user avatar
  • 7,307
-3 votes
2 answers
5k views

I can't get this image to be displayed in a tkinter gui because it doesn't recognize the image file or directory, here is my code: import tkinter as tk from PIL import ImageTk, Image root = tk.Tk() ...
Zach Goodman's user avatar
4 votes
1 answer
3k views

I am trying to make a minor modification to a python script made by my predecessor and I have bumped into a problem. I have studied programming, but coding is not my profession. The python script ...
Zsolt Mester's user avatar
0 votes
2 answers
3k views

I am using the PyCharm IDE. I marked a folder as a resource root and wanted to get a file from its directory and was wondering the appropriate way to do so. In Java, you can use getClass()....
Fred James's user avatar

15 30 50 per page