15,181 Topics

Member Avatar for
Member Avatar for manohar1111

hello sir, I have doubt that how to redirect the ouput text of a command (while working on unix cmd prompt) to a file using python.please help me with sample code.

Member Avatar for Gribouillis
0
186
Member Avatar for renierdbruyn

I am new to Pyramid, Python, Jinja2 , jQuery AJAX, MongoDB and mongoengine. I was told to delvelop a system using these technologies. I am at a point where I do not know how to go futher. I have searched the web for answers, but found nothing that is helpful. …

0
112
Member Avatar for renierdbruyn

I am new to Pyramid, Python, Jinja2 , jQuery AJAX, MongoDB and mongoengine. I was told to delvelop a system using these technologies. I am at a point where I do not know how to go futher. I have searched the web for answers, but found nothing that is helpful. …

0
108
Member Avatar for speen

Hello there? I am extremely new to python, and am trying to attend the lectures about hashing. Please cd you ceck the following code and error, and just tell me how to make it work. Please I am not that advanced user of python. I am very basic. def create(smallest, …

Member Avatar for speen
0
243
Member Avatar for lewashby

Is there a function that I can use to find out if a file is a block device? And another for a character device. I'm trying to create a funtion that will build a string the is exactly like the result you get from running ls -l for a slightly …

Member Avatar for woooee
0
539
Member Avatar for Gribouillis

This snippet prints a python list of strings in multicolumn format (similarly to linux `ls` command). It uses module prettytable, available in [pypi](https://pypi.python.org/pypi/PrettyTable).

Member Avatar for Gribouillis
3
2K
Member Avatar for chophouse

I'm having trouble calling a function I've written after importing the module containing it. The module is called funky.py. Here is the code for funky.py: from ftplib import FTP_TLS #### FUNCTION --- fileup() #### for sending file via FTP TLS ## ## arg1 .. destname > the filename to be …

Member Avatar for chophouse
0
17K
Member Avatar for AARTI SHRIVAS

i am just start to learnin python and i want to know some thing about it 1.is is used for web development 2.how can i run python program on my ubuntu os i have python installed on my system but not able to run i don't know how to run …

Member Avatar for snippsat
0
437
Member Avatar for venkaaaaat

hi, can you please help me with a sample python code to retrive data from command prompt which appears after execution of some commanad for eg: ./vershion.sh gives ouput as version: 7.0.0.9 type : NAS thanks in advance

Member Avatar for manohar1111
0
591
Member Avatar for 06njack

Hello all, I've been set a lab assignment and am really struggling to get to grips with it. The aim to to create a "grass-roots" program that doesn't make heavy use of built in functions. Namely "string.replace()" in this case! Any ideas as to why the below code doesn't work? …

Member Avatar for woooee
0
280
Member Avatar for Gribouillis

This snippet is reserved for users of the KDE linux desktop. It adds a *service menu* to kde applications such as dolphin and konqueror, to launch an ipython dashboard in a directory in one click. More specifically, save the text of this snippet as a file `~/.kde/share/kde4/services/ServiceMenus/opennotebook.desktop` (create the directory …

1
626
Member Avatar for booicu

Evening Community! Alright. As you can see I am "newbie" on the block. When I try approaching my professor for assistance she tells me to go to my book. But I digress. If I was able to use a while loop this would be more simplified. But our professor is …

Member Avatar for woooee
0
17K
Member Avatar for CodingCabbage

I used code originally by vegaseat what's wrong with code ** error : Traceback (most recent call last): File "C:/Users/Cameron/Computing Work/Year 13/F454 - Computing Project/Design/newthingnewthing.py", line 68, in <module> canvas.create_rectangle(x0, y0, x1, y1, fill="purple") AttributeError: 'NoneType' object has no attribute 'create_rectangle'** _______________________________________________ code: from tkinter import * data = [10, …

Member Avatar for CodingCabbage
0
3K
Member Avatar for CodingCabbage

is there a way of in a loop automatically setting different commands to different buttons as they are created (automatically created via loops) or is there a way of setting custom names to the buttons while they arecreated in a loop i want "buttonName" to be different and known for …

Member Avatar for vegaseat
0
241
Member Avatar for Astudent

So I have another problem(new project new code), with a rather lengthy code. The problem is I am getting tkinter errors left and right and I can't find why. The error I get is: File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "N:\dkaul\CLASS-VSFX160-01\sklock20\Python\blackjack\Black.py", line 212, in <module> …

Member Avatar for vegaseat
0
7K
Member Avatar for CodingCabbage

I'm trying to represent my data using a bar graph, the data being displayed is goodVotes, neutralVotes and badVotes on the x-axis for each of my pieces of data (records in an sqlite3 database). I wish the "bookName" of each record to be displayed on the x axis of the …

Member Avatar for vegaseat
0
282
Member Avatar for Prithiv_1

I am getting output as json string with the following code. But I require it as JSON dict without leading and trailing quotes. How can I do that? It seems to work if I uncomment line4 but not with raw input. def main(args): f = open(args[1], 'w') inp = raw_input("Enter …

Member Avatar for vegaseat
0
290
Member Avatar for Netcode

Am new to python and i need help dealing so i would go ahead and post the question and my little solution so far. **Question:** a Procedure which takes four parameters as follows; Dictionary File- the file name of a text file containing four letter words Start Word- a four …

Member Avatar for Netcode
0
294
Member Avatar for aditya369
Member Avatar for james.lu.75491856

THIS IS DANGEROOUS CODE, if it fails, it may prevent yu frome editing it. also, you can use the functions to do crazy stuff. Look at [this refrence](http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx) and change the `0x12` to what you want. (This one hold alt, so typing r will actibvate the menu that starts with …

Member Avatar for sneekula
-4
361
Member Avatar for turbo22

Ok, i've gotten pretty far on a code but keep getting an error. I know it's something simple but i just can't put my finger on it please help. import os import pickle class Student(object): def _init_(self): self._students = {} def addStudent(self, name): self._students[name] = [0, 0, 0] def editStuData(self): …

Member Avatar for BearofNH
0
1K
Member Avatar for vegaseat

Shows you how to create multiple Tkinter buttons in a loop, each with its own name, label and command response.

Member Avatar for CodingCabbage
2
1K
Member Avatar for chophouse

Need help understanding this error, and how to eliminate it. Using Python 3.3. I'm trying to define a function that takes two arguments and then constructs the proper arguments for a call to the ftblib.storbinary method. Here's my code: from ftplib import FTP_TLS ftps = FTP_TLS('xxxxxx', user='xxxx', passwd='xxxx') ftps.prot_p() ftps.set_pasv(False) …

Member Avatar for chophouse
0
9K
Member Avatar for vegaseat

The code sample shows how to get an image from the internet and show it in a Tkinter label widget.

Member Avatar for Nils_1
4
2K
Member Avatar for lewashby

(Linux) `output = os.listdir()` In the above line of code I'm getting the name of the file(s) in a given directory, but how can I also get the permissions? This is what I want to see. -rwxr-xr-x 1 garrett garrett 158 Nov 23 10:49 dirlist.py drwxr-xr-x 2 garrett garrett 4096 …

Member Avatar for lewashby
0
147
Member Avatar for chophouse

I'm writing a script to automatically up load a file from Server A to FTP server B. I'm getting stuck at the connecting part. I can connect with a python script using regular FTP, and have done so, but when trying to implement a SSL connection, I keep getting a …

Member Avatar for chophouse
0
3K
Member Avatar for Crazyscript77

Hi all, just wondering if someone could help me out with a small loop question. If I had an input field in a GUI which writes to variable "counter" (a numerical value), how would I be able to use this value to control the amount of times a loop is …

Member Avatar for Crazyscript77
0
183
Member Avatar for krystosan

I have a function in which i want to mock `os.listdir` that returns directory content to variable `dirContent` def setUp(self): self._filePaths = ["/test/file/path"] self.mox = mox.Mox() def imageFilePaths(paths): imagesWithPath = [] for _path in paths: try: dirContent = os.listdir(_path) except OSError: raise OSError("Provided path '%s' doesn't exists." % _path) for …

0
139
Member Avatar for Py New BB

Hello all, by using Python, i want to pickup the news titles on http://www.boston.com/yourtown/ and save them into a .txt file. i have 2 questions: 1. how can i have the codes run every 2 hours? 2. how can i have the outputs write into a .txt file? thanks. from …

Member Avatar for snippsat
0
162
Member Avatar for nouth

for example I don't know what this is called ยป `[('cat', 'meow'), ('dog', 'ruff')]` if I try `for l in [('cat', 'meow'), ('dog', 'ruff')]: print l` I am using l for lady luck lucy not I for I or the number 1 + maybe even | pipe for smoking it …

Member Avatar for vegaseat
0
246

The End.