15,175 Topics

Member Avatar for
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
6K
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
146
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
Member Avatar for RAJESH.M

hello sir, my work is run version.sh file and collect the values of version and type in the output. i have around 500 servers,so i want to automate this process using pyhton. i had written sample code shown below, but it is not giving good results.will you please help me …

Member Avatar for rrashkin
0
170
Member Avatar for lewashby

#!/usr/bin/python3 import sys input1 = sys.argv[1] def print_params(*params): print(params) print_params(input1) #END# In the above code how can I call all the command line arguments with the prin_params function without having to code input1, input2, input3, etc... When I'm doing testing liket this I would like to be able to just …

Member Avatar for vegaseat
0
234
Member Avatar for johnny_disco

Hi All, I am trying to scrape a piece of HTML similar to the below where I want beautiful soup to return something like: List Price, £28,410 Body Style, Open Car etc etc. I thought if I did this: soup = BeautifulSoup(html_doc) tag = soup.find_all('tr') tag_td = tag[0].find('td') tag_b = …

Member Avatar for BearofNH
0
225
Member Avatar for Yarynka

I'm curious.. is it possible to extend the context of the word "monstrous" in concordance so we have: >>> text1.concordance("monstrous") Building index... Displaying 11 of 11 matches: ong the former , one was of a most monstrous size . ... This came towards us , ON OF THE PSALMS . …

Member Avatar for Yarynka
0
103
Member Avatar for Iceman10284

Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and the display the following data: • The lowest number in the array • The highest number in the array • The total of the numbers in …

Member Avatar for booicu
-1
7K
Member Avatar for Waseemaburakia

I'm trying to modify a Bibblesort code I'm writing that will count the number of instances and print out a seperate line for each instance and how many occurances it had. def BubbleSortList(MyList): ComparisonCounter = 0 for j in range ( len(MyList)): for i in range ( len(MyList)-1-j ): if …

Member Avatar for Waseemaburakia
0
290

The End.