Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
valueerror
- Page 1
Re: Java Coin Flip Program
Programming
Software Development
5 Days Ago
by jassonadder
… flip the coin? ")) flipper = CoinFlipper() flipper.flipCoin(flips) except
ValueError
: print("Please enter a valid integer.") This version…
ValueError - Not Working
Programming
Software Development
18 Years Ago
by babutche
…quot;": break try: grade = float(grade_str) except
ValueError
: print "Error, use floating point number"…quot;": break try: credits = float(credits_str) except
ValueError
: print "Error, use floating point number"…
Re: ValueError - Not Working
Programming
Software Development
18 Years Ago
by woooee
…quot;": break try: grade = float(grade_str) except
ValueError
: print "Error, use floating point number" return…floating point number" except : print grade except
ValueError
: print "Error, use floating point number&…
ValueError: signal only works in main thread. HUH? It's worked before.
Programming
Software Development
15 Years Ago
by JustAnotherJoe
…, Python 2.6) and now I'm getting this error:
ValueError
: signal only works in main thread After encountering this error… to ping.py. My question is not what causes the
valueerror
, but how is it possible for it to work on…
ValueError: too many values to unpack
Programming
Software Development
14 Years Ago
by danholding
i am getting a
ValueError
message when running my code i am currently converting from … <module> for lastmod_seconds, val in date_file_list: [/code=python]
ValueError
: too many values to unpack i can see that it…
ValueError with script
Programming
Software Development
17 Years Ago
by Laurence26
… I want to quit and save it gives and error
ValueError
: need more than 2 values to unpack I have no…
ValueError: unpack tuple of wrong size
Programming
Software Development
17 Years Ago
by b04e3ian
… to call the functions in main I get this error:
ValueError
: unpack tuple of wrong size I somewhat understand that the…
ValueError: Mixing iteration and read methods would lose data
Programming
Software Development
9 Years Ago
by rufael
we have the following code: I get the response (
ValueError
: Mixing iteration and read methods would lose data) Any help …
Print returns ValueError (Help)
Programming
Software Development
14 Years Ago
by Hawkeye Python
…. The computer played %b and %c" % (player_card1, computer_card1, computer_card2)
ValueError
: unsupported format character 'a' (0x61) at index 12[/QUOTE] player_card1…
Re: Print returns ValueError (Help)
Programming
Software Development
14 Years Ago
by snippsat
…;interactive input>", line 1, in <module>
ValueError
: unsupported format character 'S' (0x53) at index 14 >>…
python - ValueError: need more than 0 values to unpack
Programming
Software Development
11 Years Ago
by varshaholla
…['values'], res_lst_srt['keys'] = zip(*sorted(zip(res_lst_srt['values'], res_lst_srt['keys'])))
ValueError
: need more than 0 values to unpack Any suggestions, so…
except ValueError... i dont know how to fix it
Programming
Software Development
3 Years Ago
by Jan_102
…=(input("zadej b ")) try : return int (číslo) except
ValueError
print("nebylo zadané číslo") barca=b() A = int…
Re: except ValueError... i dont know how to fix it
Programming
Software Development
3 Years Ago
by Husoski
…=(input("zadej b ")) try : return int (číslo) except
ValueError
: print("nebylo zadané číslo") print("y = a…
Re: except ValueError... i dont know how to fix it
Programming
Software Development
3 Years Ago
by Reverend Jim
…: '): while True: number = (input(prompt)) try : return int (number) except
ValueError
: print("That is not a number. Try again."…
Re: ValueError - Not Working
Programming
Software Development
18 Years Ago
by vegaseat
The return statement will not only break out of the while loop but also out of function main()!! If you enter data in a loop you need to accumulate the entries in some fashion.
Re: ValueError - Not Working
Programming
Software Development
18 Years Ago
by babutche
Thank You for your help. I had tried to put another "try, except" statement in my program but I didn't do it right. I never really thought about the "int(grade_string)". Right now I do not have any plans for any Tinker or other GUI interface. But I have done it before. I thought it was very hard and confusing. Of course, …
Re: ValueError: signal only works in main thread. HUH? It's worked before.
Programming
Software Development
15 Years Ago
by Gribouillis
I took my ping.py from [url]ftp://ftp.visi.com/users/mdc/ping.py[/url]. It seems that doOne accepts a timeout argument. Why don't you use it ?
Re: ValueError: signal only works in main thread. HUH? It's worked before.
Programming
Software Development
15 Years Ago
by JustAnotherJoe
[QUOTE=Gribouillis;986878]I took my ping.py from [url]ftp://ftp.visi.com/users/mdc/ping.py[/url]. It seems that doOne accepts a timeout argument. Why don't you use it ?[/QUOTE] I'm using the identical ping.py module that you referenced above. As I said in my original post, I [B]do use a timeout parameter[/B], but as I previously said, I've seen …
Re: ValueError: signal only works in main thread. HUH? It's worked before.
Programming
Software Development
15 Years Ago
by JustAnotherJoe
Wow. I wish I could erase my entire moronic thread. Long story short. The code at work was the same as home. Somehow the modified code with the signal handler was overwritten at work and I didn't notice until I returned to the office location. I ASSumed. Mea culpa.
Re: ValueError: too many values to unpack
Programming
Software Development
14 Years Ago
by danholding
for sum reason it didnt like that code here it is again with tabs and python coding sorting but still same problem [CODE]# sorts files by modifed date, collects the 6 most recent files, and delete all others. #created by dan holding v0.1 (23 Aug 2010) import os, glob, time, marshal, shutil os.mkdir("file_back_ups") root = '.' …
Re: ValueError: too many values to unpack
Programming
Software Development
14 Years Ago
by woooee
[QUOTE]for lastmod_seconds, val in date_file_list:[/QUOTE]Obviously you should print at least part of date_file_list. No one here has ESP AFAIK, so no one can discern the contents of date_file_list, but what happens if no file is found. [CODE] date_file_tuple = lastmod_seconds, file date_file_list= tuple(date_file_tuple) …
Re: ValueError with script
Programming
Software Development
17 Years Ago
by vegaseat
Your problem is that book.items() gives you a key, value pair where value is most likely a tuple (year, roles). You have to edit your function like this ... [code=python]def saveBook(book): store = open(filename, 'w') for name, val in book.items(): year, roles = val store.write(name + '\n') store.write(year +…
Re: ValueError with script
Programming
Software Development
17 Years Ago
by bachmabt
I just started messing around with Python the other day...this may be the first program I've compiled over 10 lines that wasn't a straight copy and paste from the online help. I believe the problem was "book" only had 2 elements in it (not 3). The second element was a list making book a 2d array. Anyway, I'm sure there is a more …
Re: ValueError with script
Programming
Software Development
17 Years Ago
by vegaseat
You can only load data with pickle that has been saved/dumped with pickle, since it saves the entire object as a byte stream, in your case the object would be the book dictionary. Here is an example ... [code=python]# pickle saves and loads any Python object intact # via a byte stream # use module cPickle for higher speed import pickle …
Re: ValueError with script
Programming
Software Development
17 Years Ago
by Laurence26
Wel thanks for your help I have solved it with the thread of vegaseat. Thanks a lot
Re: ValueError: unpack tuple of wrong size
Programming
Software Development
17 Years Ago
by BearofNH
Lisa says: Please put code samples in between [noparse][code=Python][/noparse] and [noparse][/code][/noparse] brackets so it displays properly. As near as I can tell, moveHomer() returns a pair (row,column) and you are trying to unpack that into a 4-tuple. That just won't work.
Re: ValueError: unpack tuple of wrong size
Programming
Software Development
17 Years Ago
by b04e3ian
thanks I managed to figure it out. :)
Re: ValueError: unpack tuple of wrong size
Programming
Software Development
17 Years Ago
by vegaseat
b04e3ian, please use 4 spaces per indentation and try not to exceed 72 characters per code line, it will make your code much more readable for all of us. Good luck with your game and welcome to DaniWeb.
Re: ValueError: Mixing iteration and read methods would lose data
Programming
Software Development
9 Years Ago
by Gribouillis
Try def extract_data(filename): with open(filename) as infile: v0 = next(infile) return v0, list(infile) Note that this will fail if there is no line in the file.
Re: ValueError: Mixing iteration and read methods would lose data
Programming
Software Development
9 Years Ago
by ~s.o.s~
Also, `next` takes an optional `default` argument so you can easily call `v0 = next(infile, None)` and check the value of `v0` before proceeding...
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC